package com.wc.alorithm_blue_bridge._模拟.Q4583;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2023/11/9 21:00
 * @description 小蓝的奇妙冒险
 * https://www.lanqiao.cn/problems/4583/learning/?page=1&first_category_id=1
 */
public class MainTest {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int r = sc.nextInt();
        int ans = 0;
        for (int i = 1; i <= r; i++) {
            if (i % 3 == 0 || i % 5 == 0 || i % 7 == 0) {
                ans++;
            }
        }
        System.out.println(ans);
    }
}
